<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<script type="text/javascript">
		var str="  ";
		if(str.match(/^[ ]*$/)){
			console.log("1111");
		}else{
			console.log("2222");
		}
	</script>
</body>
</html>